﻿<ResourceDictionary 
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic" 
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	mc:Ignorable="d">
	<Style x:Key="ProgressBarPSE" TargetType="{x:Type ProgressBar}">
		<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>
		<Setter Property="BorderBrush" Value="{x:Static Microsoft_Windows_Themes:ClassicBorderDecorator.ClassicBorderBrush}"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ProgressBar}">
					<Microsoft_Windows_Themes:ClassicBorderDecorator BorderStyle="ThinPressed" BorderThickness="{TemplateBinding BorderThickness}" Background="#FFE8E8E8" BorderBrush="#FF999999">
						<DockPanel Margin="0,0,2,2" x:Name="PART_Track" LastChildFill="false">
							<Rectangle x:Name="PART_Indicator">
								<Rectangle.Fill>
									<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
										<GradientStop Color="#FF0B4714" Offset="1"/>
										<GradientStop Color="#FF68E443" Offset="0.095"/>
										<GradientStop Color="#FF0D6C3A" Offset="0.533"/>
										<GradientStop Color="#FF2D981F" Offset="0.522"/>
									</LinearGradientBrush>
								</Rectangle.Fill>
							</Rectangle>
						</DockPanel>
					</Microsoft_Windows_Themes:ClassicBorderDecorator>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Style.Triggers>
			<Trigger Property="Orientation" Value="Vertical">
				<Setter Property="Template">
					<Setter.Value>
						<ControlTemplate TargetType="{x:Type ProgressBar}">
							<Microsoft_Windows_Themes:ClassicBorderDecorator Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderStyle="ThinPressed" BorderThickness="{TemplateBinding BorderThickness}">
								<DockPanel Margin="0,0,2,2" x:Name="PART_Track" LastChildFill="false">
									<Decorator x:Name="PART_Indicator" DockPanel.Dock="Bottom">
										<Rectangle>
											<Rectangle.LayoutTransform>
												<RotateTransform Angle="-90"/>
											</Rectangle.LayoutTransform>
											<Rectangle.Fill>
												<MultiBinding>
													<MultiBinding.Converter>
														<Microsoft_Windows_Themes:ProgressBarBrushConverter/>
													</MultiBinding.Converter>
													<Binding Path="Foreground" RelativeSource="{RelativeSource TemplatedParent}"/>
													<Binding Path="IsIndeterminate" RelativeSource="{RelativeSource TemplatedParent}"/>
													<Binding Path="ActualHeight" ElementName="PART_Indicator"/>
													<Binding Path="ActualWidth" ElementName="PART_Indicator"/>
													<Binding Path="ActualHeight" ElementName="PART_Track"/>
												</MultiBinding>
											</Rectangle.Fill>
										</Rectangle>
									</Decorator>
								</DockPanel>
							</Microsoft_Windows_Themes:ClassicBorderDecorator>
						</ControlTemplate>
					</Setter.Value>
				</Setter>
			</Trigger>
		</Style.Triggers>
	</Style>
</ResourceDictionary>